
/*
 * Copyright 2002-2012 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2012原作者。
 *
 *根据Apache许可证2.0版（“许可证”）获得许可；
 *除非符合许可证，否则不得使用此文件。
 *您可以在以下地址获取许可证副本：
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证分发的内容是按“原样”分发的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限和
 *许可证下的限制。
 */

package org.springframework.aop.framework.adapter;

import org.aopalliance.aop.Advice;
import org.aopalliance.intercept.MethodInterceptor;

import org.springframework.aop.Advisor;

/**
 * Interface allowing extension to the Spring AOP framework to allow
 * handling of new Advisors and Advice types.
 *
 * <p>Implementing objects can create AOP Alliance Interceptors from
 * custom advice types, enabling these advice types to be used
 * in the Spring AOP framework, which uses interception under the covers.
 *
 * <p>There is no need for most Spring users to implement this interface;
 * do so only if you need to introduce more Advisor or Advice types to Spring.
 *
 * @author Rod Johnson
 */
/**
 *接口允许对Spring AOP框架进行扩展
 *处理新的顾问和建议类型。
 *
 *＜p＞实现对象可以从
 *自定义建议类型，允许使用这些建议类型
 *在Spring AOP框架中，它在幕后使用拦截。
 *
 *＜p＞大多数Spring用户不需要实现这个接口；
 *只有当您需要向Spring引入更多Advisor或Advice类型时，才能这样做。
 *
 *@作者Rod Johnson
 */
public interface AdvisorAdapter {

	/**
	 * Does this adapter understand this advice object? Is it valid to
	 * invoke the {@code getInterceptors} method with an Advisor that
	 * contains this advice as an argument?
	 * @param advice an Advice such as a BeforeAdvice
	 * @return whether this adapter understands the given advice object
	 * @see #getInterceptor(org.springframework.aop.Advisor)
	 * @see org.springframework.aop.BeforeAdvice
	 */
	/**
	 *此适配器是否了解此建议对象？是否有效
	 *使用Advisor调用｛@code getInterceptors｝方法
	 *是否包含此建议作为论据？
	 *@param advice一个建议，如BeforeAdvice
	 *@return此适配器是否理解给定的建议对象
	 *@see#getInterceptor（org.springframework.aop.Advisor）
	 *@参见org.springframework.aop.BeforeAdvice
	 */
	boolean supportsAdvice(Advice advice);

	/**
	 * Return an AOP Alliance MethodInterceptor exposing the behavior of
	 * the given advice to an interception-based AOP framework.
	 * <p>Don't worry about any Pointcut contained in the Advisor;
	 * the AOP framework will take care of checking the pointcut.
	 * @param advisor the Advisor. The supportsAdvice() method must have
	 * returned true on this object
	 * @return an AOP Alliance interceptor for this Advisor. There's
	 * no need to cache instances for efficiency, as the AOP framework
	 * caches advice chains.
	 */
	/**
	 *返回一个AOP Alliance MethodInterceptor
	 *给出了基于拦截的AOP框架的建议。
	 *<p>不要担心Advisor中包含的任何切入点；
	 *AOP框架将负责检查切入点。
	 *@param顾问。supportsAdvice（）方法必须具有
	 *对此对象返回true
	 *@return此Advisor的AOP Alliance拦截器。有
	 *无需缓存实例以提高效率，因为AOP框架
	 *缓存建议链。
	 */
	MethodInterceptor getInterceptor(Advisor advisor);

}
